for _ in range(int(input())):
n=int(input())
if(n%2==0):
print(n//2,n//2)
else:
f=0
for i in range(2,int(n**(1/2))+1):
if(n%i==0):
f=1
break
if(f==0):
print(1,n-1)
else:
i=2
while(1):
if(n%i==0):
k=i
break
i+=1
t=n//k
v=n-t
print(t,v)
#include <bits/stdc++.h>
using namespace std;
using namespace std;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<algorithm>
#include<string.h>
#include<unordered_map>
#include<vector>
#include<unordered_set>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<map>
#include<chrono>
using namespace __gnu_pbds;
using namespace chrono;
#define int long long
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> ii;
typedef vector< pair< int, int > > vii;
typedef map<int, int> mii;
typedef pair<int, ii> pip;
typedef pair<ii, int> ppi;
#define rev(v) reverse(v.begin(), v.end())
#define print(x) for(auto & it : x)cout<<it<<' '; cout<<endl;
#define printd(x) for(auto & it : x)cout<<it.first<<' '<<it.second<<endl;
#define pi (3.141592653589)
#define sz(s) s.size()
#define mod 1000000007
#define int long long
#define float double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define rrep(i, n) for(int i=n-1;i>=0;i--)
#define rep(i,n) for(int i=0;i<n;i++)
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update > pbds; // find_by_order, order_of_key
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
bool isPrime(int n){
if(n==1) return false;
if(n==2) return true;
for(int i=2;i*i<=n;i++){
if(n%i==0)return false;
}
return true;
}
void jai_shree_ram(){
int n;
cin>>n;
for(int i=2;i*i<=n;i++){
if(n%i==0){
cout<<n/i<<" "<<n-n/i<<endl;
return;
}
}
cout<<1<<" "<<n-1<<endl;
}
int32_t main(){
fast
// injeel h_m_s
// code cses cp cf leet
int t=1;
cin>>t;
while(t--){
jai_shree_ram();
}
return 0;
}
349A - Cinema Line | 47A - Triangular numbers |
1516B - AGAGA XOOORRR | 1515A - Phoenix and Gold |
1515B - Phoenix and Puzzle | 155A - I_love_username |
49A - Sleuth | 1541A - Pretty Permutations |
1632C - Strange Test | 673A - Bear and Game |
276A - Lunch Rush | 1205A - Almost Equal |
1020B - Badge | 1353A - Most Unstable Array |
770A - New Password | 1646B - Quality vs Quantity |
80A - Panoramix's Prediction | 1354B - Ternary String |
122B - Lucky Substring | 266B - Queue at the School |
1490A - Dense Array | 1650B - DIV + MOD |
1549B - Gregor and the Pawn Game | 553A - Kyoya and Colored Balls |
1364A - XXXXX | 1499B - Binary Removals |
1569C - Jury Meeting | 108A - Palindromic Times |
46A - Ball Game | 114A - Cifera |